﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArgusPCLib.Collections.Generic;

namespace ArgusPCLib.Bird
{
	public enum FilePathFilterTypes
	{
		Include,
		Exclude
	}

	public sealed class LoggerSettings
	{
		public ItemCollection<string> FilePathTrimValues { get; private set; }
		public ItemCollection<string> FilePathFilters { get; private set; }
		public FilePathFilterTypes FilePathFilterType { get; set; }

		public LoggerSettings()
		{
			this.FilePathTrimValues = new ItemCollection<string>();
			this.FilePathTrimValues.ItemChanged += this.ItemCollection_ItemChanged;
			this.FilePathFilters = new ItemCollection<string>();
			this.FilePathFilters.ItemChanged += this.ItemCollection_ItemChanged;
			this.FilePathFilterType = FilePathFilterTypes.Include;
		}

		void ItemCollection_ItemChanged(object sender, ItemChangedEventArgs<string> e)
		{
			if (e.ChangeType != ChangeTypes.Added)
				return;
			ItemCollection<string> Sender = (ItemCollection<string>)sender;
			Sender[e.ItemIndex] = e.NewValue.ToLower();
		}
	}
}
